﻿using UnityEngine;

public class LevelWord:MonoBehaviour
{
    //父物体
    public LevelWordDoor parent;

    //代表单词
    public string word = "";

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if(collision.gameObject.GetComponent<Player>()!=null)
        {
            parent.SetWord(word);

            //这里可以随机播放一个声音
        }
    }
}
